//
// Created by bjliuyong on 2021/7/17.
//

#ifndef JVM_METADATAFACTORY_H
#define JVM_METADATAFACTORY_H

#include "memory/allocation.h"
#include "utilities/array.h"

class MetadataFactory:public AllStatic{
public:

    template <typename T>
    static Array<T>* new_array(int length) {
        // The "true" argument is because all metadata arrays are read only when
        // dumped to the shared archive
        return new (length) Array<T>(length);
    }


    template <typename T>
    static Array<T>* new_writeable_array(int length) {
        return new (length) Array<T>(length);
    }
};

#endif //JVM_METADATAFACTORY_H
